<template>
  <div class="mfunction">
    <div
      class="item"
      v-for="(i, index) in item.children"
      :key="index"
      @click="onClick(i)"
    >
      <img :src="i.model.icon" alt="" />
      <span>{{ i.model.title }}</span>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    item: Object,
  },
  methods: {
    onClick(i) {
      if (i.model.type == "cateHot") {
        this.$router.push({
          path: "/hotsift",
          query: { id: 1 }
        });
      } else if (i.model.type == "default") {
        let k = i.model.link.replace(
          "newstudios://app.xinpianchang.com/web?url=https%3A%2F%2Fwww.xinpianchang.com%2F",
          ""
        );
        k = k.split("%");
        console.log(k[0]);
        this.$router.push({ path: "/eartical", query: { id: k[0] } });
      }else if(i.model.type == "cateSelection"){
        this.$router.push({
          path: "/hotsift",
          query: { id: 2 }
        });
      }else if(i.model.type == "vmovier"){
        this.$router.push({
          path: "/hotsift",
          query: { id: 3 }
        });
      }
    },
  },
};
</script>

<style lang="less" scoped>
.mfunction {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-evenly;
  .item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    img {
      width: 40px;
      height: 40px;
      border-radius: 50%;
    }
    span {
      font-size: 14px;
      color: #000;
    }
  }
}
</style>